<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class CreateDataRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
           'device_id' => 'required',
            'site_id'  => 'required',
            'DCU1'     => 'numeric',
            'DCI1'     => 'numeric',
            'DCU2'     => 'numeric',
            'DCI2'     => 'numeric',
            'DCU3'     => 'numeric',
            'DCI3'     => 'numeric',
            'DCU4'     => 'numeric',
            'DCI4'     => 'numeric',
            'ACUA'     => 'numeric',
            'ACIA'     => 'numeric',
            'ACUB'     => 'numeric',
            'ACIB'     => 'numeric',
            'ACUC'     => 'numeric',
            'ACIC'     => 'numeric',
            'IVTemp'     => 'numeric',
            'TotGenCap' => 'numeric',
            'FR'       =>'numeric',
            'YearGenCap' =>'numeric',
            'MonthGenCap'=>'numeric',
            'LastMonthGenCap'=>'numeric',
            'DayGenCap' => 'numeric',
            'LastDayGenCap' => 'numeric',
            'PowerLimitPercent' => 'numeric',
            'ActivePower' => 'numeric',
            'ReactivePower' => 'numeric',
            'ApparentPower' => 'numeric',
            'PowerFactor' => 'numeric',
            'BoardTemp1' => 'numeric',
            'BoardTemp2' => 'numeric',
            'IVType' => 'numeric',
            'EventTime' => 'required|date',
            'EventType' => 'numeric',

        ];
    }

    public function messages()
    {
        return [
            'device_id.required' => '必须填写设备',
            'site_id.required'   => '什么站点',
            'DCU1'              =>'数字',
        ];
    }
}
